﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="userPostsAdded.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.userPostsAdded" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            font-size: x-large;
        }
        .userPostsAdded
        {
            height: 870px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <span class="style2"><strong>BMW - X6 Discussion Forum - </strong></span>
        <em style="font-size: x-large"><strong>Posts Added...</strong></em></p>
        <div class = "postsIntroContent">
        
        
        
            These are the posts which you have uploaded and their related discussions.
        
        
        
        </div>
        <br />


        <div class = "userPostsAdded">
        
        
        
        <span class="st">
    
    
    
    
        <asp:ListView ID="ListView1" runat="server" 
            DataSourceID="SqlDataSource1" 
            style="font-family: Calibri; font-size: small">
            <AlternatingItemTemplate>
                
                <strong>Post Message Replied:</strong>
                <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                <br />
                <strong>Date Posted:</strong>
                <asp:Label ID="DatePostedLabel" runat="server" 
                    Text='<%# Eval("DatePosted") %>' />
                <br />
                <strong>Time Posted:</strong>
                <asp:Label ID="TimePostedLabel" runat="server" 
                    Text='<%# Eval("TimePosted") %>' />
                <br />

                <strong>Related Discussion:</strong>
                <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />

<br /></span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                
                
                <br /><strong>Post Message Replied:</strong>
                <asp:TextBox ID="PostBodyTextBox" runat="server" 
                    Text='<%# Bind("PostBody") %>' />
                <br />
                Date Posted:
                <asp:TextBox ID="DatePostedTextBox" runat="server" 
                    Text='<%# Bind("DatePosted") %>' />
                <br />

                
                <br />Posted by:
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />
                                <strong>Related Discussion:</strong>
                 <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br />
                <br /></span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style="">
                <strong>Post Message Replied:</strong>
                <asp:TextBox ID="PostBodyTextBox0" runat="server" 
                    Text='<%# Bind("PostBody") %>' />
                <br />Date Posted:
                <asp:TextBox ID="DatePostedTextBox0" runat="server" 
                    Text='<%# Bind("DatePosted") %>' />
                <br />Time Posted:
                <asp:TextBox ID="TimePostedTextBox0" runat="server" 
                    Text='<%# Bind("TimePosted") %>' />
                <br>
                </br>
                <br />UserName:
                <asp:TextBox ID="UserNameTextBox0" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />
                                <strong>Related Discussion:</strong>
                 <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                 <br />

                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton0" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br /><br /></span>
            </InsertItemTemplate>
            <ItemTemplate>
                <strong>Post Message Replied:</strong>
                <asp:Label ID="PostBodyLabel0" runat="server" Text='<%# Eval("PostBody") %>' />
                <br />
                <strong>Date Posted:</strong>
                <asp:Label ID="DatePostedLabel0" runat="server" 
                    Text='<%# Eval("DatePosted") %>' />
                <br />
                <strong>Time Posted:</strong>
                <asp:Label ID="TimePostedLabel0" runat="server" 
                    Text='<%# Eval("TimePosted") %>' />
                <br />

                                <strong>Related Discussion:</strong>
                <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                 <br />
<br /></span>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" 
                    style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="text-align: center;background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="background-color: #008A8C; font-weight: bold;color: #FFFFFF;">
                <br />
                <strong>Post Message Replied:</strong>
                <asp:Label ID="PostBodyLabel1" runat="server" Text='<%# Eval("PostBody") %>' />
                <br />
                Date Posted:
                <asp:Label ID="DatePostedLabel1" runat="server" 
                    Text='<%# Eval("DatePosted") %>' />
                <br />
                Time Posted:
                <asp:Label ID="TimePostedLabel1" runat="server" 
                    Text='<%# Eval("TimePosted") %>' />
                <br />
                UserName:
                <asp:Label ID="UserNameLabel1" runat="server" Text='<%# Eval("UserName") %>' />
                <br />
                                <strong>Related Discussion:</strong>
                 <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
<br /></span>
            </SelectedItemTemplate>
        </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                
                
                SelectCommand="SELECT Posts.PostID, Posts.PostBody, Posts.DatePosted, Posts.TimePosted, aspnet_Users.UserName, Discussion.Title, Discussion.DiscussionID FROM ((Posts INNER JOIN Discussion ON Posts.DiscussionIDFK = Discussion.DiscussionID) INNER JOIN aspnet_Users ON Posts.UserIDFK = aspnet_Users.UserId AND Discussion.UserIDFK = aspnet_Users.UserId) WHERE (aspnet_Users.UserName = ?) ORDER BY Posts.PostID DESC">
                <SelectParameters>
                    <asp:QueryStringParameter Name="?" QueryStringField="UserID" />
                </SelectParameters>
            </asp:SqlDataSource>
        </span>
        
        
        
        </div>
</asp:Content>
